<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template avl_set_member_hook</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../intrusive/reference.html#doxygen.avl__set__hook_8hpp" title="Header &lt;boost/intrusive/avl_set_hook.hpp&gt;">
<link rel="prev" href="classboost_1_1intrusive_1_1avl__set__base__hook.html" title="Class template avl_set_base_hook">
<link rel="next" href="structboost_1_1intrusive_1_1make__avl__set__base__hook.html" title="Struct template make_avl_set_base_hook">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
<td align="center"><a href="../../../index.html">Home</a></td>
<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="classboost_1_1intrusive_1_1avl__set__base__hook.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../intrusive/reference.html#doxygen.avl__set__hook_8hpp"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="structboost_1_1intrusive_1_1make__avl__set__base__hook.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="doxygen.classboost_1_1intrusive_1_1avl__set__member__hook"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template avl_set_member_hook</span></h2>
<p>boost::intrusive::avl_set_member_hook</p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../intrusive/reference.html#doxygen.avl__set__hook_8hpp" title="Header &lt;boost/intrusive/avl_set_hook.hpp&gt;">boost/intrusive/avl_set_hook.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="special">...</span> Options<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="classboost_1_1intrusive_1_1avl__set__member__hook.html" title="Class template avl_set_member_hook">avl_set_member_hook</a> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">make_avl_set_member_hook</span><span class="special">::</span><span class="identifier">type</span> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>

  <span class="comment">// <a class="link" href="boost_container_header_reference/classboost_1_1container_1_1allocator.html#id8-bb">public member functions</a></span>
  <a class="link" href="classboost_1_1intrusive_1_1avl__set__member__hook.html#doxygen.classboost_1_1intrusive_1_1avl__set__member__hook_1a02fc5ce99b07448c5b5a2f689a41fc8f"><span class="identifier">avl_set_member_hook</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1intrusive_1_1avl__set__member__hook.html#doxygen.classboost_1_1intrusive_1_1avl__set__member__hook_1a1d692e8019b8e29cba8073c5e6ebd427"><span class="identifier">avl_set_member_hook</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1intrusive_1_1avl__set__member__hook.html" title="Class template avl_set_member_hook">avl_set_member_hook</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1intrusive_1_1avl__set__member__hook.html" title="Class template avl_set_member_hook">avl_set_member_hook</a> <span class="special">&amp;</span> <a class="link" href="classboost_1_1intrusive_1_1avl__set__member__hook.html#doxygen.classboost_1_1intrusive_1_1avl__set__member__hook_1a8063b0b9592bd4559f75bab92294a268"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1intrusive_1_1avl__set__member__hook.html" title="Class template avl_set_member_hook">avl_set_member_hook</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1intrusive_1_1avl__set__member__hook.html#doxygen.classboost_1_1intrusive_1_1avl__set__member__hook_1a21e3d798d65b9727c48f78829580f559"><span class="special">~</span><span class="identifier">avl_set_member_hook</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1intrusive_1_1avl__set__member__hook.html#doxygen.classboost_1_1intrusive_1_1avl__set__member__hook_1a63fda01182625f34ad97c62e97b4b7c6"><span class="identifier">swap_nodes</span></a><span class="special">(</span><a class="link" href="classboost_1_1intrusive_1_1avl__set__member__hook.html" title="Class template avl_set_member_hook">avl_set_member_hook</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="classboost_1_1intrusive_1_1avl__set__member__hook.html#doxygen.classboost_1_1intrusive_1_1avl__set__member__hook_1a99faafb573c893e7762a5560e1899e5c"><span class="identifier">is_linked</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1intrusive_1_1avl__set__member__hook.html#doxygen.classboost_1_1intrusive_1_1avl__set__member__hook_1a30161ea0ed6876323abfc8f7bf558360"><span class="identifier">unlink</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.17.42.4.4.4"></a><h2>Description</h2>
<p>Put a public data member <a class="link" href="classboost_1_1intrusive_1_1avl__set__member__hook.html" title="Class template avl_set_member_hook">avl_set_member_hook</a> in order to store objects of this class in an avl_set/avl_multiset. <a class="link" href="classboost_1_1intrusive_1_1avl__set__member__hook.html" title="Class template avl_set_member_hook">avl_set_member_hook</a> holds the data necessary for maintaining the avl_set/avl_multiset and provides an appropriate <a class="link" href="structboost_1_1intrusive_1_1value__traits.html" title="Struct template value_traits">value_traits</a> class for avl_set/avl_multiset.</p>
<p>The hook admits the following options: <code class="computeroutput">void_pointer&lt;&gt;</code>, <code class="computeroutput">link_mode&lt;&gt;</code> and <code class="computeroutput">optimize_size&lt;&gt;</code>.</p>
<p><code class="computeroutput">void_pointer&lt;&gt;</code> is the pointer type that will be used internally in the hook and the container configured to use this hook.</p>
<p><code class="computeroutput">link_mode&lt;&gt;</code> will specify the linking mode of the hook (<code class="computeroutput">normal_link</code>, <code class="computeroutput">auto_unlink</code> or <code class="computeroutput">safe_link</code>).</p>
<p><code class="computeroutput">optimize_size&lt;&gt;</code> will tell the hook to optimize the hook for size instead of speed. </p>
<div class="refsect2">
<a name="id-1.3.17.42.4.4.4.7"></a><h3>
<a name="id8-bb"></a><code class="computeroutput">avl_set_member_hook</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="doxygen.classboost_1_1intrusive_1_1avl__set__member__hook_1a02fc5ce99b07448c5b5a2f689a41fc8f"></a><span class="identifier">avl_set_member_hook</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: If <a class="link" href="structboost_1_1intrusive_1_1link__mode.html" title="Struct template link_mode">link_mode</a> is <code class="computeroutput">auto_unlink</code> or <code class="computeroutput">safe_link</code> initializes the node to an unlinked state.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.classboost_1_1intrusive_1_1avl__set__member__hook_1a1d692e8019b8e29cba8073c5e6ebd427"></a><span class="identifier">avl_set_member_hook</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1intrusive_1_1avl__set__member__hook.html" title="Class template avl_set_member_hook">avl_set_member_hook</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: If <a class="link" href="structboost_1_1intrusive_1_1link__mode.html" title="Struct template link_mode">link_mode</a> is <code class="computeroutput">auto_unlink</code> or <code class="computeroutput">safe_link</code> initializes the node to an unlinked state. The argument is ignored.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
<p><span class="bold"><strong>Rationale</strong></span>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <code class="computeroutput">swap</code> can be used to emulate move-semantics. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="classboost_1_1intrusive_1_1avl__set__member__hook.html" title="Class template avl_set_member_hook">avl_set_member_hook</a> <span class="special">&amp;</span> <a name="doxygen.classboost_1_1intrusive_1_1avl__set__member__hook_1a8063b0b9592bd4559f75bab92294a268"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1intrusive_1_1avl__set__member__hook.html" title="Class template avl_set_member_hook">avl_set_member_hook</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Empty function. The argument is ignored.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
<p><span class="bold"><strong>Rationale</strong></span>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <code class="computeroutput">swap</code> can be used to emulate move-semantics. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.classboost_1_1intrusive_1_1avl__set__member__hook_1a21e3d798d65b9727c48f78829580f559"></a><span class="special">~</span><span class="identifier">avl_set_member_hook</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: If <a class="link" href="structboost_1_1intrusive_1_1link__mode.html" title="Struct template link_mode">link_mode</a> is <code class="computeroutput">normal_link</code>, the destructor does nothing (ie. no code is generated). If <a class="link" href="structboost_1_1intrusive_1_1link__mode.html" title="Struct template link_mode">link_mode</a> is <code class="computeroutput">safe_link</code> and the object is stored in a set an assertion is raised. If <a class="link" href="structboost_1_1intrusive_1_1link__mode.html" title="Struct template link_mode">link_mode</a> is <code class="computeroutput">auto_unlink</code> and <code class="computeroutput"><a class="link" href="classboost_1_1intrusive_1_1avl__set__member__hook.html#doxygen.classboost_1_1intrusive_1_1avl__set__member__hook_1a99faafb573c893e7762a5560e1899e5c">is_linked()</a></code> is true, the node is unlinked.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.classboost_1_1intrusive_1_1avl__set__member__hook_1a63fda01182625f34ad97c62e97b4b7c6"></a><span class="identifier">swap_nodes</span><span class="special">(</span><a class="link" href="classboost_1_1intrusive_1_1avl__set__member__hook.html" title="Class template avl_set_member_hook">avl_set_member_hook</a> <span class="special">&amp;</span> other<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="doxygen.classboost_1_1intrusive_1_1avl__set__member__hook_1a99faafb573c893e7762a5560e1899e5c"></a><span class="identifier">is_linked</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Precondition</strong></span>: <a class="link" href="structboost_1_1intrusive_1_1link__mode.html" title="Struct template link_mode">link_mode</a> must be <code class="computeroutput">safe_link</code> or <code class="computeroutput">auto_unlink</code>.</p>
<p><span class="bold"><strong>Returns</strong></span>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <code class="computeroutput"><a class="link" href="classboost_1_1intrusive_1_1set.html#doxygen.classboost_1_1intrusive_1_1set_1aa4d9193952cf46af50cd14d1971b4dd3">set::iterator_to</a></code> will return a valid iterator.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.classboost_1_1intrusive_1_1avl__set__member__hook_1a30161ea0ed6876323abfc8f7bf558360"></a><span class="identifier">unlink</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Removes the node if it's inserted in a container. This function is only allowed if <a class="link" href="structboost_1_1intrusive_1_1link__mode.html" title="Struct template link_mode">link_mode</a> is <code class="computeroutput">auto_unlink</code>.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
</ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2005 Olaf Krzikalla<br>Copyright © 2006-2015 Ion Gaztanaga<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="classboost_1_1intrusive_1_1avl__set__base__hook.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../intrusive/reference.html#doxygen.avl__set__hook_8hpp"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="structboost_1_1intrusive_1_1make__avl__set__base__hook.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
